package com.example.lib_common.websocket

import android.net.Uri
import com.example.lib_common.utils.LoggerUtils
import org.java_websocket.client.WebSocketClient
import org.java_websocket.handshake.ServerHandshake
import java.lang.Exception
import java.net.URI

/**
 * @author yaotianxue
 * @description
 * @date 2025/3/4
 */
open class IVideoWebSocketClient constructor(serverUri: URI):WebSocketClient(serverUri) {
    companion object{
        private const val TAG = "IVideoWebSocketClient"
    }
    override fun onOpen(handshakedata: ServerHandshake?) {
        LoggerUtils.d(TAG,"onOpen")
    }

    override fun onMessage(message: String?) {
        LoggerUtils.d(TAG,"onMessage $message")
    }

    override fun onClose(code: Int, reason: String?, remote: Boolean) {
        LoggerUtils.d(TAG,"onClose $reason")
    }

    override fun onError(ex: Exception?) {
        LoggerUtils.d(TAG,"onError ${ex?.message}")
    }
}